/* =========================================================
   EAG Portfolio — Design Tokens
   Theme: "Server Console" — deep slate + terminal amber,
   with a warm paper light mode.
   ========================================================= */

:root{
  /* ---- Dark theme (default) ---- */
  --bg: #0E1319;
  --bg-elevated: #151C25;
  --bg-card: #1A222D;
  --border: #29333F;
  --border-soft: #212a35;

  --text: #E9EEF3;
  --text-muted: #8FA0B3;
  --text-faint: #5C6B7C;

  --accent: #E8A33D;        /* terminal amber */
  --accent-soft: #E8A33D22;
  --accent-2: #5FBFAE;      /* muted teal — status / secondary */
  --accent-2-soft: #5FBFAE22;

  --danger: #E06C5C;

  --shadow: 0 20px 50px -20px rgba(0,0,0,0.6);
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;

  --font-display: 'Space Grotesk', 'Inter', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  color-scheme: dark;
}

html[data-theme="light"]{
  --bg: #F6F3EC;
  --bg-elevated: #FFFFFF;
  --bg-card: #FFFFFF;
  --border: #E4DFD3;
  --border-soft: #ECE7DB;

  --text: #21262D;
  --text-muted: #5B6472;
  --text-faint: #8A93A0;

  --accent: #B4700C;
  --accent-soft: #B4700C1A;
  --accent-2: #2E8577;
  --accent-2-soft: #2E85771A;

  --danger: #C0473A;

  --shadow: 0 20px 50px -25px rgba(30,25,15,0.25);
  color-scheme: light;
}

/* =========================================================
   Reset & Base
   ========================================================= */

*, *::before, *::after{ box-sizing: border-box; }

html{ scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  *, *::before, *::after{
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body{
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.35s ease, color 0.35s ease;
  overflow-x: hidden;
}

h1,h2,h3,h4{
  font-family: var(--font-display);
  margin: 0;
  color: var(--text);
  letter-spacing: -0.01em;
}

p{ margin: 0; }
a{ color: inherit; text-decoration: none; }
ul{ margin: 0; padding: 0; list-style: none; }
button{ font-family: inherit; cursor: pointer; }

.container{
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 28px;
}

::selection{ background: var(--accent-soft); color: var(--accent); }

/* subtle grain overlay for the "console" feel */
.noise-overlay{
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

/* =========================================================
   Buttons
   ========================================================= */

.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary{
  background: var(--accent);
  color: #14100a;
}
.btn-primary:hover{
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -10px var(--accent-soft);
}

.btn-ghost{
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover{
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

/* =========================================================
   Nav
   ========================================================= */

.nav-wrap{
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-soft);
}

.nav{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
}

.nav-logo{
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}
.nav-logo-bracket{ color: var(--accent); }

.nav-links{
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link{
  position: relative;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s ease, background 0.2s ease;
}
.nav-link:hover{ color: var(--text); background: var(--bg-elevated); }
.nav-link.active{ color: var(--accent); }
.nav-link.active::after{
  content: "";
  position: absolute;
  left: 14px; right: 14px; bottom: 2px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

.theme-toggle{
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  transition: border-color 0.2s ease, transform 0.3s ease;
  flex-shrink: 0;
}
.theme-toggle:hover{ border-color: var(--accent); transform: rotate(20deg); }
.icon-moon{ display: none; }
html[data-theme="light"] .icon-sun{ display: none; }
html[data-theme="light"] .icon-moon{ display: block; }

.nav-toggle{
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 34px; height: 34px;
  background: none;
  border: none;
}
.nav-toggle span{
  width: 100%; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* =========================================================
   Hero
   ========================================================= */

.hero{
  padding: 88px 28px 96px;
}

.hero-grid{
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: center;
}

.eyebrow{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent-2);
  background: var(--accent-2-soft);
  border: 1px solid color-mix(in srgb, var(--accent-2) 40%, transparent);
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 24px;
}

.status-dot{
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 3px var(--accent-2-soft);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse{
  0%,100%{ opacity: 1; }
  50%{ opacity: 0.4; }
}

.hero-title{
  font-size: clamp(2.6rem, 5.2vw, 4.2rem);
  font-weight: 700;
  line-height: 1.05;
  margin-bottom: 14px;
}
.hero-title-accent{ color: var(--accent); }

.hero-role{
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  font-family: var(--font-mono);
  color: var(--text-muted);
  margin-bottom: 22px;
}

.hero-desc{
  max-width: 46ch;
  color: var(--text-muted);
  font-size: 1.02rem;
  margin-bottom: 34px;
}

.hero-actions{
  display: flex;
  gap: 14px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.hero-meta{
  display: flex;
  gap: 24px;
  font-size: 0.88rem;
  color: var(--text-faint);
  flex-wrap: wrap;
}

/* ---- Hero visual: photo + API card ---- */

.hero-visual{
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 560px;
}

.photo-frame{
  width: 610px;
  height: 540px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  position: relative;
  z-index: 2;
  margin-top: 8px;
}

.photo-placeholder{
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(150deg, var(--bg-elevated), var(--bg-card));
  color: var(--accent);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2.2rem;
  letter-spacing: 0.05em;
}

.api-card{
  position: absolute;
  right: -6px;
  top: 340px;
  width: 300px;
  max-width: 90vw;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  overflow: hidden;
  z-index: 3;
  animation: float 5s ease-in-out infinite;
}
@keyframes float{
  0%,100%{ transform: translateY(0); }
  50%{ transform: translateY(-10px); }
}

.api-card-head{
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-soft);
  background: var(--bg-elevated);
}
.dot{ width: 9px; height: 9px; border-radius: 50%; }
.dot-red{ background: #E06C5C; }
.dot-yellow{ background: #E8C23D; }
.dot-green{ background: #5FBFAE; }
.api-card-title{
  margin-left: 6px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-faint);
}

.api-card-body{
  margin: 0;
  padding: 16px 14px 20px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  line-height: 1.65;
  color: var(--accent-2);
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 140px;
}
.cursor{
  color: var(--accent);
  animation: blink 1s step-end infinite;
}
@keyframes blink{ 50%{ opacity: 0; } }

/* =========================================================
   Sections (shared)
   ========================================================= */

.section{
  padding: 90px 28px;
  border-top: 1px solid var(--border-soft);
}

.section-route{
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  margin-bottom: 10px;
  letter-spacing: 0.02em;
}

.section-title{
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  font-weight: 700;
  margin-bottom: 40px;
}

.reveal{
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.is-visible{
  opacity: 1;
  transform: translateY(0);
}

/* =========================================================
   About
   ========================================================= */

.about-grid{
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 48px;
  align-items: start;
}

.about-text{
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 62ch;
}

.about-stats{
  display: grid;
  gap: 16px;
}

.stat-card{
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  align-items: baseline;
  gap: 14px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.stat-card:hover{ border-color: var(--accent); transform: translateX(4px); }

.stat-num{
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}
.stat-label{
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* =========================================================
   Skills
   ========================================================= */

.skills-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 22px;
}

.skill-group{
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.skill-group:hover{ border-color: var(--accent-2); transform: translateY(-3px); }

.skill-group-title{
  font-size: 0.98rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--accent-2);
}

.skill-tags{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.skill-tags li{
  font-family: var(--font-mono);
  font-size: 0.76rem;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: border-color 0.2s ease, color 0.2s ease;
}
.skill-tags li:hover{
  border-color: var(--accent);
  color: var(--accent);
}

/* =========================================================
   Timeline (Education / Experience)
   ========================================================= */

.timeline-item{
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 24px;
  padding-bottom: 4px;
}

.timeline-marker{
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 6px;
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.timeline-content{
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 26px 28px;
}

.timeline-title{
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 6px;
}
.timeline-org{
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 4px;
}
.timeline-meta{
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent-2);
  margin-bottom: 14px;
}
.timeline-list{ display: grid; gap: 10px; }
.timeline-list li{
  color: var(--text-muted);
  font-size: 0.95rem;
  padding-left: 18px;
  position: relative;
}
.timeline-list li::before{
  content: "→";
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* =========================================================
   Achievements (empty state)
   ========================================================= */

.empty-card{
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 48px 32px;
  text-align: center;
  color: var(--text-muted);
  background: var(--bg-card);
}
.empty-card-icon{ font-size: 1.8rem; margin-bottom: 10px; }
.empty-card-title{
  font-family: var(--font-mono);
  color: var(--accent-2);
  margin-bottom: 6px;
  font-size: 0.92rem;
}
.empty-card-text{
  max-width: 42ch;
  margin: 0 auto;
  font-size: 0.9rem;
}

/* =========================================================
   Projects
   ========================================================= */

.projects-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.project-card{
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px;
  transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}
.project-card:hover{
  border-color: var(--accent);
  transform: translateY(-6px);
  box-shadow: var(--shadow);
}

.project-card-head{ margin-bottom: 14px; }
.project-index{
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
}
.project-title{
  font-size: 1.35rem;
  margin: 6px 0 2px;
}
.project-subtitle{
  font-size: 0.88rem;
  color: var(--text-muted);
}
.project-desc{
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 16px 0 20px;
}
.project-tags{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.project-tags li{
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  background: var(--accent-2-soft);
  color: var(--accent-2);
}

/* =========================================================
   Contact
   ========================================================= */

.contact-grid{
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 48px;
}

.contact-lead{
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 42ch;
  margin-bottom: 28px;
}

.contact-list{ display: grid; gap: 16px; }
.contact-list li{
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-soft);
}
.contact-label{
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.contact-list a:hover{ color: var(--accent); }

.contact-form{
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  display: grid;
  gap: 18px;
}

.form-row{ display: grid; gap: 8px; }
.form-row label{
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}
.form-row input, .form-row textarea{
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  resize: vertical;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-row input:focus, .form-row textarea:focus{
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-submit{ margin-top: 4px; width: 100%; }
.form-submit:disabled{
  opacity: 0.65;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}
.form-status{
  font-size: 0.88rem;
  color: var(--accent-2);
  min-height: 1.2em;
  transition: color 0.3s ease;
  line-height: 1.4;
}
.form-status.success{ color: var(--accent-2); font-weight: 500; }
.form-status.error{ color: var(--danger); font-weight: 500; }

/* =========================================================
   Footer
   ========================================================= */

.footer{
  padding: 32px 28px 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--text-faint);
  font-size: 0.82rem;
  border-top: 1px solid var(--border-soft);
}
.footer-status{
  display: flex;
  align-items: center;
  gap: 6px;
}

/* =========================================================
   Focus visibility
   ========================================================= */

a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible{
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 900px){
  .hero-grid{ grid-template-columns: 1fr; }
  .hero-visual{ margin-top: 24px; justify-content: flex-start; min-height: unset; }
  .api-card{ position: static; margin-top: 24px; animation: none; }
  .about-grid{ grid-template-columns: 1fr; }
  .contact-grid{ grid-template-columns: 1fr; }
}

@media (max-width: 760px){
  .nav-toggle{ display: flex; }
  .nav-links{
    position: fixed;
    top: 66px; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    padding: 12px;
    gap: 2px;
    transform: translateY(-130%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    z-index: 90;
  }
  .nav-links.open{ transform: translateY(0); opacity: 1; }
  .nav-link{ padding: 12px 14px; }

  .hero{ padding: 56px 20px 64px; }
  .section{ padding: 64px 20px; }
}

@media (max-width: 480px){
  .hero-actions{ flex-direction: column; align-items: stretch; }
  .photo-frame{ width: 240px; height: 240px; }
}

